/* dialogs.h is part of VIP program
 * Written by J. Salvador Arias, 2010
 *      CONICET, INSUE, Instituto Miguel Lillo,
 *      Miguel Lillo 205, S.M. de Tucuman (4000)
 *      Tucuman, Argentina
 *      e-mail: jsalarias@csnat.unt.edu.ar
 *
 * VIP is a free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation and
 * Creative Commons.
 *
 * This file and the VIP program is distributed in the hope
 * that it will be useful, but WITHOUT ANY WARRANTY; without
 * even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * To view a copy of this license, visit
 * http://creativecommons.org/licenses/GPL/2.0/
 * or send a letter to
 * Creative Commons, 171 Second Street, Suite 300,
 * San Francisco, California, 94105, USA.
 */

#ifndef DIALOGS_HEADER_INCLUDED
#define DIALOGS_HEADER_INCLUDED

#include <gtk/gtk.h>
#include "progbar.h"

typedef struct tagGRIDDIALOG GRIDDIALOG;
struct tagGRIDDIALOG {
 GtkWidget* dialog;
 GtkWidget* sizeEntry;
 GtkWidget* fillEntry;
 GtkWidget* mooreRadio;
 GtkWidget* vonneRadio;
};

GRIDDIALOG* GridDialog (SREAL size, SINTEGER fill, SFLAG editable);
void DestroyGridDialog (GRIDDIALOG* grid);

typedef struct tagENTRYDIALOG ENTRYDIALOG;
struct tagENTRYDIALOG {
 GtkWidget* dialog;
 GtkWidget* entry;
};

ENTRYDIALOG* CounterEntryDialog (GtkWindow* parent, SCOUNTER count, gchar* name, gchar* caption);
ENTRYDIALOG* RealEntryDialog (GtkWindow* parent, SREAL number, gchar* name, gchar* caption);
ENTRYDIALOG* TextEntryDialog (GtkWindow* parent, gchar* text, gchar* name, gchar* caption);
void DestroyEntryDialog (ENTRYDIALOG* toDel);

typedef struct tagCENTREDIALOG CENTREDIALOG;
struct tagCENTREDIALOG {
 GtkWidget* dialog;
 GtkWidget* latEntry;
 GtkWidget* lonEntry;
};

CENTREDIALOG* CentreDialog ();
void DestroyCentreDialog (CENTREDIALOG* centre);

typedef struct tagMAPLIMITSDIALOG MAPLIMITSDIALOG;
struct tagMAPLIMITSDIALOG {
 GtkWidget* dialog;
 GtkWidget* northEntry;
 GtkWidget* southEntry;
 GtkWidget* eastEntry;
 GtkWidget* westEntry;
};

MAPLIMITSDIALOG* MapLimitsDialog (SREAL n, SREAL s, SREAL e, SREAL w);
void DestroyMapLimitsDialog (MAPLIMITSDIALOG* mapLimits);

typedef struct tagSEARCHDIALOG SEARCHDIALOG;
struct tagSEARCHDIALOG {
 GtkWidget* dialog;
 GtkWidget* iterEntry;
 GtkWidget* holdEntry;
 GtkWidget* pageCheck;
 GtkWidget* flipCheck;
 GtkWidget* consCheck;
 GtkWidget* noSecRadio;
 GtkWidget* startSecRadio;
 GtkWidget* secRadio;
 GtkWidget* secSizeEntry;
 GtkWidget* noAnnealRadio;
 GtkWidget* blindAnnealRadio;
 GtkWidget* gibbsAnnealRadio;
 GtkWidget* nixonAnnealRadio;
 GtkWidget* generationEntry;
 GtkWidget* equalEntry;
 GtkWidget* keepCheck;
 GtkWidget* allCheck;
};

SEARCHDIALOG* SearchDialog ();
void DestroySearchDialog (SEARCHDIALOG* searchDialog);

typedef struct tagREFINEDIALOG REFINEDIALOG;
struct tagREFINEDIALOG {
 GtkWidget* dialog;
 GtkWidget* simpleRadio;
 GtkWidget* fuseRadio;
 GtkWidget* holdEntry;
 GtkWidget* pageCheck;
 GtkWidget* flipCheck;
 GtkWidget* consCheck;
};

REFINEDIALOG* RefineDialog ();
void DestroyRefineDialog (REFINEDIALOG* refineDialog);

typedef struct tagSEARCHPROGDLG SEARCHPROGDLG;
struct tagSEARCHPROGDLG {
 GtkWidget* dialog;
 GtkWidget* treeProgress;
 GtkWidget* iterProgress;
 GtkWidget* stopButton;
 SFLAG progressUp;
 PROGRESSSTRUCT* progressData;
};

SEARCHPROGDLG* SearchProgress (PROGRESSSTRUCT* progress, SFLAG mode);
void DestroyProgressSearchDialog (SEARCHPROGDLG* toDel);

gboolean UpdateSearchProgress (gpointer data);

typedef struct tagREFINEPROGDLG REFINEPROGDLG;
struct tagREFINEPROGDLG {
 GtkWidget* dialog;
 GtkWidget* treeProgress;
 GtkWidget* refineProgress;
 GtkWidget* stopButton;
 SFLAG progressUp;
 PROGRESSSTRUCT* progressData;
};

REFINEPROGDLG* RefineProgress (PROGRESSSTRUCT* progress, SFLAG mode);
void DestroyProgressRefineDialog (REFINEPROGDLG* toDel);

gboolean UpdateRefineProgress (gpointer data);

typedef struct tagPARSINGPROGDLG PARSINGPROGDLG;
struct tagPARSINGPROGDLG {
 GtkWidget* dialog;
 GtkWidget* fileProgress;
 SFLAG progressUp;
 PROGRESSSTRUCT* progressData;
};

PARSINGPROGDLG* ParsingProgress (PROGRESSSTRUCT* progress);
void DestroyParsingProgressDialog (PARSINGPROGDLG* toDel);

gboolean UpdateParsingProgress (gpointer data);

typedef struct tagACTIVPROGDLG ACTIVPROGDLG;
struct tagACTIVPROGDLG {
 GtkWidget* dialog;
 GtkWidget* progress;
 SFLAG progressUp;
};

ACTIVPROGDLG* ActivityProgress (gchar* title);
void DestroyActivityProgressDialog (ACTIVPROGDLG* toDel);

gboolean UpdateActivityProgress (gpointer data);

typedef struct tagGEOREFBROWSERDLG GEOREFBROWSERDLG;
struct tagGEOREFBROWSERDLG {
 GtkWidget* dialog;
 GtkWidget* spEntry;
 GtkWidget* nameEntry;
 GtkWidget* latEntry;
 GtkWidget* lonEntry;
 GtkWidget* collecEntry;
 GtkWidget* catalogEntry;
 GtkWidget* urlEntry;
 GtkWidget* referenceEntry;
 GtkWidget* identifierEntry;
 GtkWidget* sampleEntry;
 GtkWidget* collectorEntry;
 GtkWidget* nextButton;
 GtkWidget* prevButton;
 GtkWidget* applyButton;
 GtkWidget* delButton;
 GEOREF* actGeo;
};

GEOREFBROWSERDLG* GeoRefBrowser (GEOREF* geo, SFLAG mode);

typedef struct tagNODEDATADIALOG NODEDATADIALOG;
struct tagNODEDATADIALOG {
 GtkWidget* dialog;
 GtkWidget* nameEntry;
 GtkWidget* ageEntry;
};

NODEDATADIALOG* NodeDataDialog (GNode* node, SFLAG mode);
void DestroyNodeDataDialog (NODEDATADIALOG* toDel);

#endif
